var box = document.getElementById('box');
var good2 = document.getElementById('good2');
var good3 = document.getElementById('good3');
var ear1 = document.getElementById('ear1');
var ear2 = document.getElementById('ear2');
box.style.width = document.documentElement.clientWidth + 'px';
box.style.height = document.documentElement.clientHeight + 'px';

// 实现我要领包包
function handleEvent(event){
	var event = event || window.event;
	newWindow = window.open('http://www.udache.com/app/mQuickReg/index?channel=10&channelId=30983&source=&sourceid=&type=&category=1','_self','width = document.documentElement.clientWidth,height = document.documentElement.clientHeight')

}
good2.addEventListener('touchstart',handleEvent,false);

// 实现朋友圈的功能
function handleFriend(event){
	// newWindow = window.open('friend.html','_self','width = window.document.documentElement.clientWidth,height = window.document.documentElement.clientHeight');
	var fu = document.createElement('img');
	fu.id = 'fu';
	// fu.style.src = '../img/结果页/分享浮层.png';
	fu.setAttribute('src','../img/结果页/分享浮层.png');
	box.appendChild(fu);
	fu.style.width = 100 + '%';
	fu.style.height = 100 + '%';
	fu.style.backgroundColor = 'black';
	fu.style.opacity = '0.7';

}
good3.addEventListener('touchstart',handleFriend,false);

// 实现眼珠转动
var de = -15;
var sc = 1;
var time = setInterval(function(){
	de += 2;
	sc += 0.01;
	if(de > 15){
		de = -15;
		sc =1;
	}
	ear1.style.transform = 'rotate(' + de + 'deg)';
	ear2.style.transform = 'rotate(' + de + 'deg)';
	ear1.style.transform = 'scale(' + sc + ')';
	ear2.style.transform = 'scale(' + sc + ')';

},10);
